<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix' => 'admin/constructionPurchase',
    'namespace' => 'Frieza\\Modules\\ConstructionPurchase\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {
    //施工采买频道-分类
    //一级分类
    $router->get('/category/index', 'CategoryController@index');//列表
    $router->get('/category/index/create', 'CategoryController@editFirst');//新增
    $router->get('/category/index/{id}/edit', 'CategoryController@editFirst');//编辑
    $router->post('/category/index/saveFirst', 'CategoryController@saveFirst');//保存
    $router->delete('/category/index/{id}', 'CategoryController@delFirst');//删除
    $router->post('/category/sort', 'CategoryController@sortFirst');//排序
    $router->put('/category/index/{id}/', 'CategoryController@switchFirst');//切换状态
    //二级分类
    $router->get('/category/index/{firstId}/edit/create', 'CategoryController@editSecond');//新增
    $router->get('/category/index/{firstId}/edit/{secondId}/edit', 'CategoryController@editSecond');//编辑
    $router->post('/category/index/saveSecond', 'CategoryController@saveSecond');//保存
    $router->delete('/category/index/{firstId}/edit/{secondId}', 'CategoryController@delSecond');//删除
    $router->post('/category/index/{firstId}/sort', 'CategoryController@sortSecond');//排序
    $router->put('/category/index/{firstId}/edit/{secondId}', 'CategoryController@switchSecond');//切换状态

    //施工采买频道-原创栏目
    $router->get('/subject/index', 'SubjectColumnsController@index');
    $router->get('/subject/index/create', 'SubjectColumnsController@edit');
    $router->get('/subject/index/{id}/edit', 'SubjectColumnsController@edit');
    $router->post('/subject/index/save', 'SubjectColumnsController@save');//保存
    $router->delete('/subject/index/{id}', 'SubjectColumnsController@del');//删除
    $router->post('/subject/sort', 'SubjectColumnsController@sort');//排序
    $router->put('/subject/index/{id}/', 'SubjectColumnsController@switch');//切换状态

    //施工采买-施工工序
    $router->get('/process', 'ProcessController@index');
    $router->get('/process/create', 'ProcessController@editProcess');
    $router->get('/process/{id}/edit', 'ProcessController@editProcess');
    $router->post('/process/save', 'ProcessController@saveProcess');//保存
    $router->delete('/process/{id}', 'ProcessController@delProcess');//删除
    //工序Tab
    $router->get('/process/{processId}/edit/create', 'ProcessController@editTab');
    $router->get('/process/{processId}/edit/{tabId}/edit', 'ProcessController@editTab');
    $router->post('/process/saveTab', 'ProcessController@saveTab');//保存
    $router->delete('/process/{processId}/edit/{tabId}', 'ProcessController@delTab');//删除
    $router->post('/process/{processId}/sort', 'ProcessController@sortTab');//排序
    //工序Tab下模块
    $router->get('/process/{processId}/edit/{tabId}/edit/addModule/{moduleType}', 'ProcessController@addModule');
    $router->get('/process/{processId}/edit/{tabId}/edit/{moduleId}/edit', 'ProcessController@editModule');
    $router->post('/process/saveModule', 'ProcessController@saveModule');//保存
    $router->delete('/process/{processId}/edit/{tabId}/edit/{moduleId}', 'ProcessController@delModule');//删除
    $router->post('/process/{processId}/edit/{tabId}/sort', 'ProcessController@sortModule');//排序
    $router->put('/process/{processId}/edit/{tabId}/edit/{moduleId}', 'ProcessController@switchModule');//切换状态
    //模块下的内容
    $router->get('/process/{processId}/edit/{tabId}/edit/{moduleId}/edit/create', 'ProcessController@editModuleContent');
    $router->get('/process/{processId}/edit/{tabId}/edit/{moduleId}/edit/{contentId}/edit', 'ProcessController@editModuleContent');
    $router->post('/process/saveModuleContent', 'ProcessController@saveModuleContent');//保存
    $router->delete('/process/{processId}/edit/{tabId}/edit/{moduleId}/edit/{contentId}', 'ProcessController@delModuleContent');//删除
    $router->post('/process/{processId}/edit/{tabId}/edit/{moduleId}/sort', 'ProcessController@sortModuleContent');//排序
    $router->get('/process/module/content/searchkeyword', 'ProcessController@previewSearchKeyword');//排序
});